﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Manager/Views/Shared/ManagerLayout.cshtml";
}


@{
    ViewBag.Title = "Edit";
    Layout = "~/Areas/Manager/Views/Shared/ManagerLayout.cshtml";
}
<title>清空数据</title>
<article class="page-container">

    <form class="form form-horizontal" id="form1">
        <div class="row cl" style="text-align:center">
            <div class="formControls col-xs-8 col-sm-9">
                <button id="fat-btn" class="btn btn-danger" style="width:100px;height:110px;" onclick="formPost()"  data-loading-text="Loading..."
                        type="button">
                    清空数据
                </button>
            </div>
        </div>
    </form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script src="~/DirectSellJs/manager/lib/ueditor/ueditor.config.js"></script>
<script src="~/DirectSellJs/manager/lib/ueditor/ueditor.all.min.js"></script>
<script src="~/DirectSellJs/manager/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    function formPost() {
        layer.prompt({
            formType: 1,
            value: '',
            title: '请输入管理员密码'
        }, function (password, index) {
         //加载层
        var index = layer.load(1, {
            shade: [0.1, '#fff']
        });
            $.ajax({
                type: "post",
                url: "/Manager/DelMsg/DelMsg",
                data:{ password: password } ,
        }).success(function (message) {
            if (message != "初始化成功") {
                layer.msg(message, { icon: 2 });
            }
            else {
                layer.msg('初始化成功', { icon: 1 });
            }
        }).fail(function (err) {
            console.log(err);
            layer.msg('系统错误,请稍后重试!', { icon: 2 });
        })
        layer.closeAll();//关闭加载层
        });
    }

    //layer.confirm('清空之前请先备份数据库,确定要执行吗？', {
    //    btn: ['确定', '取消'] //按钮
    //}, function () {
    //    //加载层
    //    var index = layer.load(1, {
    //        shade: [0.1, '#fff']
    //    });
    //    $.ajax({
    //        type: "post",
    //        url: "/Manager/VirtualMoneyAudit/Allowance",
    //        data: $('#form1').serialize(),
    //    }).success(function (message) {
    //        if (message == "操作成功,请审核") {
    //            window.parent.location.reload();//刷新父页面
    //        }
    //        else {
    //            layer.msg(message, { icon: 2 });
    //        }
    //    }).fail(function (err) {
    //        console.log(err);
    //        layer.msg('系统错误,请稍后重试!', { icon: 2 });
    //    })
    //    layer.closeAll();//关闭加载层
    //});

</script>